﻿@{
    ViewBag.Title = "ProjectInfo";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@using DepartmentWork.Model
@model DepartmentWork.Model.ProjectManagementInfoViewModel
    <link href="~/Assets/plugins/bootstrap-select/bootstrap-select.min.css" rel="stylesheet" />
    <script src="~/Assets/plugins/bootstrap-select/bootstrap-select.min.js"></script>

<link href="~/Assets/plugins/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet" />
<link href="~/Assets/plugins/bootstrap-datepicker/css/datepicker-theme.css" rel="stylesheet" />
<script src="~/Assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="~/Assets/plugins/chosen/chosen.jquery.min.js"></script>
<script src="~/Assets/js/pages/form-elements.js"></script>
    <style>
        .btn-default {
            color: #333;
            background-color: #FFF;
            border-color: #CCC;
            height: 34px;
        }
    </style>

<div class="page-header">
    <div class="pull-left">
        <ol class="breadcrumb visible-sm visible-md visible-lg">
            <li><a href="@Url.Action("Index","Home",new{area=""})"><i class="icon fa fa-home"></i>主页</a></li>
            <li><a href="@Url.Action("Index","Home",new{area="ProjectManageArea"})"><i class="fa fa-envelope"></i>项目模块</a></li>
            <li class="active"><a href="#"><i class="fa fa-envelope"></i>项目详情</a></li>
        </ol>
    </div>
</div>


@{
    if (ViewBag.Flag == "EditTrue")
    {
      <div class="alert alert-success">
	    <button type="button" class="close" data-dismiss="alert">×</button>
	    <strong>&emsp;项目编辑成功</strong> 
      </div>
    }
    if (ViewBag.Flag == "EditFalse")
    {
      <div class="alert alert-danger">
	    <button type="button" class="close" data-dismiss="alert">×</button>
	    <strong>&emsp;项目编辑失败！</strong> @ViewBag.FlagInfo
    </div>
    }

    if (ViewBag.Flag == "StatusTrue")
    {
      <div class="alert alert-success">
	    <button type="button" class="close" data-dismiss="alert">×</button>
	    <strong>&emsp;项目状态编辑成功</strong> 
      </div>
    }
    if (ViewBag.Flag == "StatusFalse")
    {
      <div class="alert alert-danger">
	    <button type="button" class="close" data-dismiss="alert">×</button>
	    <strong>&emsp;项目状态编辑失败！</strong> @ViewBag.FlagInfo
    </div>
    }
}

<div class="row" style="margin: 0 auto">

</div>
<div class="col-md-8 col-xs-12" style="width: 70%">
    <div class="panel bk-widget bk-border-off bk-noradius">
        <div class="panel">
            <div class="panel-heading bk-bg-primary">
                <h6><i class="fa fa-table red"></i><span class="break"></span>@this.Model.PROJECT_MANAGEMENT_TITLE 的项目简况</h6>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td style="width: 15%"><b>项目名称:</b></td>
                                <td style="width: 35%" data-project-field="name">@this.Model.PROJECT_MANAGEMENT_TITLE</td>
                                <td style="width: 15%"><b>项目编号:</b></td>
                                <td style="width: 35%" data-project-field="no">@this.Model.PROJECT_MANAGEMENT_NO</td>
                            </tr>

                            <tr>
                                <td><b>创建日期:</b></td>
                                <td>@this.Model.PROJECT_MANAGEMENT_CREATETIME.ToString("yyyy-MM-dd")</td>
                                <td><b>预计完成日期:</b></td>
                                <td data-project-field="deadline">@this.Model.PROJECT_MANAGEMENT_DEADTIME.ToString("yyyy-MM-dd")</td>
                            </tr>

                            <tr>
                                <td><b>业务联系人:</b></td>
                                <td data-project-field="contact">@this.Model.PROJECT_MANAGEMENT_BUINESS_CONTACT</td>
                                <td><b>联系电话:</b></td>
                                <td data-project-field="tel">@this.Model.PROJECT_MANAGEMENT_BUINESS_TEL</td>

                            </tr>
                            
                            <tr>
                                <td><b>业务部门:</b></td>
                                <td data-project-field="contact">@this.Model.PROJECT_MANAGEMENT_BUINESS_DEPARTMENT</td>
                                <td><b>业务类型:</b></td>
                                <td data-project-field="tel">@this.Model.PROJECT_MANAGEMENT_BUINESS_TYPE</td>

                            </tr>

                            <tr>
                                <td><b>项目描述:</b></td>
                                <td colspan="3" data-project-field="description">@this.Model.PROJECT_MANAGEMENT_CONTENT</td>
                            </tr>
                            <tr>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="col-lg-4 col-md-12" style="width: 30%;float: right">
    <div class="panel panel-default">
        <div class="panel-heading bk-bg-white">
            <h4><b>项目操作</b></h4>
            <div class="panel-actions">
                <a href="#" class="btn-minimize"><i class="fa fa-caret-up"></i></a>
                <a href="#" class="btn-close"><i class="fa fa-times"></i></a>
                
            </div>
        </div>
        <div class="panel-body bk-noradius">
            <div class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">

                <div class="row">
                    <div class="col-xs-9 bk-vcenter">
                        <span>项目负责人：<b>@this.Model.PROJECT_MANAGEMENT_LEADER </b></span>
                    </div>
                </div>
                
                

                <div class="row">

                    <div class="col-xs-9 bk-vcenter">
                        <span>当前项目状态：<b style="color:firebrick">
                                         @{
                                             if (this.Model.PROJECT_MANAGEMENT_STATUS==0)
                                             {
                                                 @:进行中
                                             }
                                             else
                                             {
                                                 @:已完成
                                             }
                                         }
                                     </b></span>
                    </div>
                </div>
            </div>
            <hr class="bk-margin-off">
            <div class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                
                <div class="row">
                    <div class="col-xs-9 bk-vcenter">
                       @{
                           if (ViewBag.IsAdmin == true)
                            {
                               <a data-toggle="modal" data-target="#editProjectModal">
                                    <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">项目编辑</h4>
                                </a>
                                <a data-toggle="modal" data-target="#changeProjectStateModal">
                                    <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">项目状态操作</h4>
                                </a>
                            }
                        }

                    </div>
                </div>
            </div>
            <hr class="bk-margin-off">
            <div class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                <div class="row">
                    <div class="col-xs-9 bk-vcenter">
                      <a href="@Url.Action("Index", "WorkReocred", new { area = "ProjectManageArea", projectId = ViewBag.projectId })" >
                                    <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">工作记录</h4>
                                </a>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>


<!-- 模态框（Modal） -->

<div class="modal fade" id="editProjectModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

    <script>

        window.onload = function ()
        {
            $("#datetimepicker").datepicker();
        };
    </script>

    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">编辑项目
                </h4>
            </div>
            <form method="POST" action="@Url.Action("EditProject", "Project", new { area = "ProjectManageArea" })">
                <div class="modal-body">
                    <div class="row">
                        <input type="hidden" name="hid_ProjectId" value="@this.Model.PROJECT_MANAGEMENT_ID"/>
                        <label class="col-md-3 control-label" for="text-input">项目名称</label>
                        <div class="col-md-9">
                            <input id="tb_ProjectName" style="border-color: cornflowerblue" value="@this.Model.PROJECT_MANAGEMENT_TITLE" name="tb_ProjectName" class="form-control" placeholder="Text" type="text">
                            <span class="span_ProjectName"></span>
                        </div>
                    </div>
                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">项目编号：</label>
                        <div class="col-md-9">
                            <input id="tb_ProjectNo" disabled="disabled" value="@this.Model.PROJECT_MANAGEMENT_NO" style="border-color: cornflowerblue" name="tb_ProjectNo" class="form-control" placeholder="Text" type="text">
                            <span class="span_ProjectNo"></span>
                        </div>
                    </div>
                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label">负责人：</label>
                        <div class="col-md-9" style="max-height: 34px">
                            <input id="tb_ProjectLeader" value="@this.Model.PROJECT_MANAGEMENT_LEADER" style="border-color: cornflowerblue" name="tb_ProjectLeader" class="form-control" placeholder="Text" type="text">
                            <span class="span_ProjectLeader"></span>
                        </div>
                    </div>

                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label">截至日期：</label>
                        <div class="col-md-9">
                            <div class="input-append date" id="datetimepicker" data-date="@DateTime.Now.ToString("yyyy-MM-dd")" data-date-format="yyyy-mm-dd">
                                <input name="tb_DeadTime" style="border-color: cornflowerblue" class="form-control" size="16" type="text" value="@this.Model.PROJECT_MANAGEMENT_DEADTIME.ToString("yyyy-MM-dd")">
                                <span class="add-on"><i class="icon-th"></i></span>
                            </div>
                            <span class="span_DevelopDescription"></span>
                        </div>
                    </div>

                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">功能描述：</label>
                        <div class="col-md-9">
                            <textarea id="tb_DevelopDescription" name="tb_DevelopDescription" rows="5" class="form-control" placeholder="Content..">@this.Model.PROJECT_MANAGEMENT_CONTENT</textarea>
                        </div>
                    </div>

                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">业务联系人：</label>
                        <div class="col-md-9">
                            <input id="text-input" value="@this.Model.PROJECT_MANAGEMENT_BUINESS_CONTACT" name="tb_BusinessUser" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">业务联系人电话：</label>
                        <div class="col-md-9">
                            <input id="text-input" value="@this.Model.PROJECT_MANAGEMENT_BUINESS_TEL" name="tb_BusinessUserTel" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="submit" class="btn btn-primary" value="提交更改"/>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>



<!-- 模态框（Modal） -->

<div class="modal fade" id="changeProjectStateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">


    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel2">项目状态操作
                </h4>
            </div>
            <form action="@Url.Action("EditProjectStatus", "Project")" method="POST">
                <div class="modal-body">
                    <input type="hidden" name="hid_ProjectId" value="@this.Model.PROJECT_MANAGEMENT_ID"/>
                    <div class="row">
                        <br />
                        <label class="col-md-3 control-label">项目状态操作：</label>
                        <div class="col-md-9">

                            <select name="select_ProjectStatus" class="form-control select2">
                                <option value="0">进行中</option>
                                <option value="1">完成</option>
                            </select>
                        </div>
                    </div>

                    <br />

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="submit" class="btn btn-primary" value="提交更改"/>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>
